package backing;

public class TestCourseSelectedCourse {public static void main(String[] args) {
    // 1. 创建教师
    Teacher teacher1 = new Teacher("T001", "张三", "男", null);
    Teacher teacher2 = new Teacher("T002", "李四", "女", null);
    // 2. 创建课程并关联教师
    Course course1 = new Course("C001", "Java编程", "A101", "周一上午", teacher1);
    Course course2 = new Course("C002", "数据库原理", "B202", "周三下午", teacher2);
    // 3. 完善教师与课程的双向关联
    teacher1 = new Teacher(teacher1.getId(), teacher1.getName(), teacher1.getGender(), course1);
    teacher2 = new Teacher(teacher2.getId(), teacher2.getName(), teacher2.getGender(), course2);
    // 4. 创建学生
    Student student1 = new Student("S001", "王五", "男");
    Student student2 = new Student("S002", "赵六", "女");
    // 模拟业务流程
    System.out.println(teacher1.getName() + " 开设了《" + course1.getName() + "》");
    System.out.println(teacher2.getName() + " 开设了《" + course2.getName() + "》\n");
    student1.selectCourse(course1);
    student2.selectCourse(course2);
    System.out.println();
    student2.dropCourse();
    System.out.println();
    student1.printSchedule();
    System.out.println();
    student2.printSchedule();
}
}
